package com.itwen.web;

import com.itwen.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @program: demo
 * @author: Li Wenwen
 * @create: 2019-01-31 09:25
 */
@Controller
public class MyController {

    @Autowired
    private UserService userService;

    @RequestMapping("/")
    @ResponseBody
    public String hello(){
        return "hello admin";
    }
    @RequestMapping("/login")
    public String login(){
        return "login.html";
    }
    @GetMapping("/save")
    public void save(
            @RequestParam("username") String username,
            @RequestParam("password") String password
            ){
        userService.save(username,password);
    }
}
